package com.ucomm.talent.adapter;

import java.util.ArrayList;

import com.ucomm.talent.AppConfig;
import com.ucomm.talent.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class CategoryInfoAdapter extends BaseAdapter {
	private LayoutInflater layoutInflater;
	private String[] mData;
	
	public CategoryInfoAdapter(Context context,String[] mData) {
		this.layoutInflater = LayoutInflater.from(context);
		this.mData = mData;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return mData.length;
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return mData[position];
	}
	
	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}
	
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		
			convertView = layoutInflater.inflate(R.layout.category_item, null);
			TextView categoryText = (TextView) convertView.findViewById(R.id.category_info);
			String text = mData[position];
			String category = null;
			if(AppConfig.jobMap.size()!=0){
				category = AppConfig.jobMap.get(text);
			}
			categoryText.setText(category);
		return convertView;
	}

	public String[] getmData() {
		// TODO Auto-generated method stub
		return mData;
	}

}
